package vtt.android.cartoon_video.fragments;

import vtt.android.cartoon_video.BaseApplication;
import vtt.android.cartoon_video.dialogs.DialogManager;
import vtt.android.library.utils.VttLog;
import android.app.Activity;
import android.os.Bundle;
import android.support.v4.app.Fragment;

import com.google.android.gms.ads.AdRequest;
import com.google.android.gms.ads.AdView;

public class BaseFragment extends Fragment {
	
	/* define constant */
	protected static final String ARG_SECTION_NUMBER = "section_number";
	
	protected VttLog log = null;
	protected DialogManager mDialogManager;

	@Override
    public void onAttach(Activity activity) {
        super.onAttach(activity);
        log = new VttLog(getClass().getSimpleName(), BaseApplication.isDebuggable);
        mDialogManager = new DialogManager(getActivity());
    }
	
	@Override
	public void onActivityCreated(Bundle savedInstanceState) {
	    super.onActivityCreated(savedInstanceState);
	    // set has menu
	    setHasOptionsMenu(true);
	}

	protected void loadAdmob(AdView adView) {
		// Look up the AdView as a resource and load a request.
		AdRequest adRequest = new AdRequest.Builder()
		        .addTestDevice(AdRequest.DEVICE_ID_EMULATOR)
//				.addTestDevice("AD3EA773211B100433F351BBFFAE240C")
				.build();
		adView.loadAd(adRequest);
	}
	
	@Override
	public void onDestroy() {
	    super.onDestroy();
	    log.d("VTT>>> " + "onDestroy");
	}
	
	@Override
	public void onDetach() {
	    super.onDetach();
	    log.d("VTT>>> " + "onDetach");
	}
}
